
public class TestString04 {
	public static void main(String[] args) {
		A a1 = new A();
		a1.a = 12;
		A a2 = new A();
		a2.a = 12;
		
		System.out.println(a1==a2);
		System.out.println(a1.equals(a2));
		
		String str1 = "abc";
		String str2 = "abc";
		System.out.println(str1==str2);
		
		String str3 = new String("abc");
		String str4 = new String("abc");
		System.out.println(str3==str4);
		
		System.out.println(str1==str3);
		System.out.println(str1.equals(str3));
	}
}

class A {
	int a;
	
	@Override
	public boolean equals(Object obj) {
		A ta = (A)obj;
		return ta.a==this.a;
	}
}
